package com.dyava.dycache;

import com.alibaba.fastjson.TypeReference;
import com.dyava.dycache.core.CacheDefined;
import org.slf4j.impl.SimpleLogger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.ArrayList;
import java.util.List;

/**
 * Hello world!
 *
 */
@SpringBootApplication
public class DycacheSpringbootDemoApp
{
    static {
        System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY,"debug");
        System.setProperty(SimpleLogger.SHOW_SHORT_LOG_NAME_KEY,"true");
    }
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
        SpringApplication.run(DycacheSpringbootDemoApp.class,args);
    }

    @Bean
    List<CacheDefined> cacheDefinedList(){
        List<CacheDefined> cacheDefinedList = new ArrayList<>();
        cacheDefinedList.add(new CacheDefined("test:cache2",new TypeReference<String>(){}.getType(),false,new int[]{10,100000}));
        return cacheDefinedList;
    }

}
